package com.health.system.javacommon.util;

/**
 * 状态中文名与状态码之间的转换
 * 
 * @author pch 2010.6.11
 * 
 */
public class StatusConvert {

	/**
	 * 把业务数字状态码转为中文
	 * 
	 * @author pch 2010.6.11
	 * 
	 * @param statusNumber
	 *            数字状态码
	 * @return 数字状态码对应的中文
	 */
	public static String numberToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 00:
				status = "待提交";
				break;
			case 01:
				status = "已提交";
				break;
			case 10:
				status = "申请变更";
				break;
			case 11:
				status = "变更提交";
				break;
			case 20:
				status = "退回修改";
				break;
			case 21:
				status = "修改提交";
				break;
			case 22:
				status = "初审通过";
				break;
			case 25:
				status = "已商用";
				break;
			case 32:
				status = "初审被拒";
				break;
			case 35:
				status = "终审被拒";
				break;
			case 50:
				status = "合作暂停";
				break;
			case 98:
				status = "合作终止";
				break;
			case 99:
				status = "历史";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 把业务中文状态转为数字状态码
	 * 
	 * @author pch 2010.6.11
	 * 
	 * @param status
	 *            中文状态
	 * @return 数字状态码
	 */
	public static String stringToNumber(String status) {
		String statusNumber = null;
		if (status != null) {
			if (status.equals("待提交")) {
				statusNumber = "00";
			} else if (status.equals("已提交")) {
				statusNumber = "01";
			} else if (status.equals("申请变更")) {
				statusNumber = "10";
			} else if (status.equals("变更提交")) {
				statusNumber = "11";
			} else if (status.equals("退回修改")) {
				statusNumber = "20";
			} else if (status.equals("修改提交")) {
				statusNumber = "21";
			} else if (status.equals("初审通过")) {
				statusNumber = "22";
			} else if (status.equals("已商用")) {
				statusNumber = "25";
			} else if (status.equals("初审被拒")) {
				statusNumber = "32";
			} else if (status.equals("终审被拒")) {
				statusNumber = "35";
			} else if (status.equals("合作暂停")) {
				statusNumber = "50";
			} else if (status.equals("合作终止")) {
				statusNumber = "98";
			} else if (status.equals("历史")) {
				statusNumber = "99";
			}
		}
		return statusNumber;
	}

	/**
	 * 把业务包数字状态码转为中文
	 * 
	 * @author pch 2010.6.29
	 * 
	 * @param statusNumber
	 *            数字状态码
	 * @return 数字状态码对应的中文
	 */
	public static String busiBagModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "已组包";
				break;
			case 13:
				status = "组包退回";
				break;
			case 14:
				status = "组包确认";
				break;
			case 16:
				status = "CP招商";
				break;
			case 18:
				status = "停止招商";
				break;
			case 21:
				status = "初审被拒";
				break;
			case 26:
				status = "初审通过";
				break;
			case 31:
				status = "终审被拒";
				break;
			case 36:
				status = "终审通过";
				break;
			case 41:
				status = "测试计费";
				break;
			case 46:
				status = "已计费";
				break;
			case 51:
				status = "已商用";
				break;
			case 56:
				status = "已变更";
				break;
			case 61:
				status = "已暂停";
				break;
			case 66:
				status = "已下线";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 把业务包类型数字码转为中文
	 * 
	 * @author pch 2010.6.29
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 数字类型对应的中文
	 */
	public static String busiBagTypeToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "点播包";
				break;
			case 16:
				status = "套餐包";
				break;
			case 21:
				status = "精品包";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 把计费类型数字码转为中文
	 * 
	 * @author pch 2010.6.29
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 数字类型对应的中文
	 */
	public static String calculateTypeToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "点播";
				break;
			case 16:
				status = "包月";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 把业务接入数字状态码转为中文
	 * 
	 * @author pch 2010.6.29
	 * 
	 * @param statusNumber
	 *            数字状态码
	 * @return 数字状态码对应的中文
	 */
	public static String busiProceModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "待提交";
				break;
			case 16:
				status = "已提交";
				break;
			case 31:
				status = "接入被拒";
				break;
			case 33:
				status = "初审被拒";
				break;
			case 36:
				status = "初审通过";
				break;
			case 41:
				status = "终审被拒";
				break;
			case 46:
				status = "终审通过";
				break;
			case 48:
				status = "测试计费";
				break;
			case 49:
				status = "已计费";
				break;
			case 51:
				status = "已商用";
				break;
			case 56:
				status = "已退出";
				break;
			case 61:
				status = "已暂停";
				break;
			case 66:
				status = "已下线";
				break;
			case 71:
				status = "已取消";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 把关键字、关键字组数字码转为中文
	 * 
	 * @author pch 2010.6.29
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 数字类型对应的中文
	 */
	public static String keywordTypeToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "正常";
				break;
			case 16:
				status = "已暂停";
				break;
			case 21:
				status = "已屏蔽";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 把内容数字状态码转为中文
	 * 
	 * @author pch 2010.7.12
	 * 
	 * @param statusNumber
	 *            数字状态码
	 * @return 内容数字状态码对应的中文
	 */
	public static String contentModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "待提交";
				break;
			case 16:
				status = "已提交";
				break;
			case 21:
				status = "初审被拒";
				break;
			case 26:
				status = "初审通过";
				break;
			case 31:
				status = "终审被拒";
				break;
			case 36:
				status = "终审通过";
				break;
			case 41:
				status = "已发布";
				break;
			case 46:
				status = "申请退回";
				break;
			case 51:
				status = "已退回";
				break;
			case 56:
				status = "已暂停";
				break;
			case 61:
				status = "已屏蔽";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 收费方式数字码转为中文
	 * 
	 * @author pch 2010.7.12
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 收费方式数字类型对应的中文
	 */
	public static String payTypeToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 16:
				status = "收费";
				break;
			case 11:
				status = "免费";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 小说连载状态数字码转为中文
	 * 
	 * @author pch 2010.7.15
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 小说连载状态对应的中文
	 */
	public static String continueModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "连载中";
				break;
			case 16:
				status = "已完结";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 把敏感词汇状态转为中文
	 * 
	 * @author 盛复康 2010.7.20
	 */
	public static String senstiveTypeToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "正常";
				break;
			case 16:
				status = "已暂停";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 评论状态数字码转为中文
	 * 
	 * @author pch 2010.7.21
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 评论状态对应的中文
	 */
	public static String reviewModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "开启";
				break;
			case 16:
				status = "关闭";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 客服工单状态数字码转为中文
	 * 
	 * @author pch 2010.7.26
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 客服工单状态对应的中文
	 */
	public static String serviceOrderModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "待处理";
				break;
			case 16:
				status = "已处理";
				break;
			case 21:
				status = "已办结";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 工单来源数字码转为中文
	 * 
	 * @author pch 2010.7.26
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 工单来源对应的中文
	 */
	public static String orderFromToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "用户电话";
				break;
			case 16:
				status = "移动工单";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 工单是否逾期数字码转为中文
	 * 
	 * @author pch 2010.7.26
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 工单是否逾期对应的中文
	 */
	public static String overDueToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "按期";
				break;
			case 16:
				status = "超期";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 问题类型数字码转为中文
	 * 
	 * @author pch 2010.7.26
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 问题类型对应的中文
	 */
	public static String questionTypeToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "订购查/退";
				break;
			case 16:
				status = "业务咨询";
				break;
			case 21:
				status = "业务投诉";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 是否开通SNS状态转为中文
	 * 
	 * @author tls 2010.8.02
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 是否开通SNS状态的中文
	 */
	public static String snsSwitchToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "未开通";
				break;
			case 16:
				status = "已开通";
				break;
			case 21:
				status = "已暂停";
				break;
			case 26:
				status = "已屏蔽";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * 用户状态转为中文
	 * 
	 * @author tls 2010.8.02
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 用户状态的中文
	 */
	public static String modeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "正常";
				break;
			case 16:
				status = "已暂停";
				break;
			case 21:
				status = "已屏蔽";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/***
	 *产中状态对应名称
	 *csh 
	 */
	public static String changeProductModeNoToName(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "SPOA提交";
				break;
			case 16:
				status = "测试中";
				break;
			case 21:
				status = "已商用";
				break;
			case 26:
				status = "已登记";
				break;
			case 31:
				status = "已暂停";
				break;
			case 36:
				status = "已下线";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * CP状态转为中文
	 * 
	 * @author pch 2010.8.6
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return CP状态对应的中文
	 */
	public static String cpModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 90:
				status = "初始";
				break;
			case 00:
				status = "待提交";
				break;
			case 01:
				status = "已提交";
				break;
			case 10:
				status = "申请变更";
				break;
			case 11:
				status = "变更提交";
				break;
			case 20:
				status = "退回修改";
				break;
			case 21:
				status = "修改提交";
				break;
			case 22:
				status = "初审通过";
				break;
			case 25:
				status = "已商用";
				break;
			case 32:
				status = "初审被拒";
				break;
			case 35:
				status = "终审被拒";
				break;
			case 50:
				status = "合作暂停";
				break;
			case 98:
				status = "合作终止";
				break;
			case 99:
				status = "历史";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	/**
	 * CP性质状态转为中文
	 * 
	 * @author pch 2010.8.6
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return CP性质状态对应的中文
	 */
	public static String cpNatureToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 8:
				status = "本省";
				break;
			default:
				status = "全国";
				break;
			}
		}
		return status;
	}

	/**
	 * CP合作类型状态转为中文
	 * 
	 * @author pch 2010.8.6
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return CP合作类型状态对应的中文
	 */
	public static String cpCoopTypeToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 1:
				status = "基本型";
				break;
			case 2:
				status = "紧密型";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}
	
	/**
	 * author      :  陈书华;  
	 * create time : Aug 9, 2010;
	 * modify time : Aug 9, 2010;
	 * return      : String;
	 * 对内容推荐信息的状态名称转化
	 */
	public static String crModeNOToName(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "待发布";
				break;
			case 16:
				status = "已发布";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}

	
	//订购状态:0001:准备发起订购关系 0999：完成订购计费请求 1000：订购关系同步确认 0998:发起订购
	//订购状态:1001:准备发起退订关系 1999：完成退订计费请求 9999：退订关系同步确认 1998:发起退订
	/**
	 * author      :  陈书华;  
	 * create time : Aug 10, 2010;
	 * modify time : Aug 10, 2010;
	 * return      : String;
	 * csh
	 */
	public static String changeBillMOdeNoToName(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			if("0001".equals(statusNumber)){
				status="准备发起订购";
			}else if("0998".equals(statusNumber)){
				status="发起订购";
			}else if("0999".equals(statusNumber)){
				status="完成订购计费";
			}else if("1000".equals(statusNumber)){
				status="已订购";
			}else if("1001".equals(statusNumber)){
				status="准备发起退订";
			}else if("1998".equals(statusNumber)){
				status="发起退订";
			}else if("1999".equals(statusNumber)){
				status="完成退订计费";
			}else if("9999".equals(statusNumber)){
				status="已退订";
			}else{
				status="";
			}
		}
		return status;
	}

	/**
	 * author      :  陈书华;  
	 * create time : Aug 10, 2010;
	 * modify time : Aug 10, 2010;
	 * return      : String;
	 * 栏目类型
	 */
	public static String changeCategoryTypeToName(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			if("1".equals(statusNumber)){
				status="内部栏目";
			}else if("2".equals(statusNumber)){
				status="外部链接";
			}else if("3".equals(statusNumber)){
				status="单网页栏目";
			}else{
				status="";
			}
		}
		return status;
	}

	/**
	 * author      :  陈书华;  
	 * create time : Aug 10, 2010;
	 * modify time : Aug 10, 2010;
	 * return      : String;
	 * 有开和关的状态都可以用这个
	 */
	public static String changeFlagModeNoToName(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			if("0".equals(statusNumber)){
				status="关闭";
			}else if("1".equals(statusNumber)){
				status="开启";
			}else{
				status="";
			}
		}
		return status;
	}
	
	/**
	 * 地域转为中文
	 * 
	 * @author tls 2010.8.25
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 收费方式数字类型对应的中文
	 */
	public static String sectionToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 11:
				status = "华语";
				break;
			case 16:
				status = "日韩";
				break;
			case 21:
				status = "欧美";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}
	
	/**
	 * 版权状态转为中文
	 * 
	 * @author tls 2010.9.06
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return 收费方式数字类型对应的中文
	 */
	public static String copyrightModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 00:
				status = "待提交";
				break;
			case 01:
				status = "已商用";
				break;
			case 02:
				status = "已暂停";
				break;
			case 98:
				status = "已终止";
				break;
			}
		}
		return status;
	}

	/**
	 * CP业务账期状态转为中文
	 * 
	 * @author sfk 2010.9.6
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return CP业务账期状态对应的中文
	 */
	public static String cpAccountModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 00:
				status = "初始生成";
				break;
			case 07:
				status = "可发布";
				break;
			case 10:
				status = "发布";
				break;
			case 20:
				status = "已查阅";
				break;
			case 30:
				status = "异议";
				break;
			case 40:
				status = "已处理";
				break;
			case 50:
				status = "确认";
				break;
			case 60:
				status = "暂停";
				break;
			case 98:
				status = "已结算";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}
	

	/**
	 * Sep 8, 2010
	 * String
	 * csh
	 * TODO:结算单状态转化成名称
	 */
	public static String statementModeNoToName(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 00:
				status = "初始生成";
				break;
			case 01:
				status = "误差范围内";
				break;
			case 02:
				status = "误差范围外";
				break;
			case 13:
				status = "已排查";
				break;
			case 50:
				status = "可生成CP结算单";
				break;
			case 98:
				status = "已生成cp业务结算单";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}
	
	
	
	/**
	 * CP业务账期状态转为中文
	 * 
	 * @author sfk 2010.9.6
	 * 
	 * @param statusNumber
	 *            数字类型
	 * @return CP业务账期状态对应的中文
	 */
	public static String cpBusiModeNoToString(String statusNumber) {
		String status = null;
		if (statusNumber != null && !"".equals(statusNumber)) {
			switch (Integer.parseInt(statusNumber)) {
			case 25:
				status = "商用";
				break;
			case 50:
				status = "暂停";
				break;
			case 98:
				status = "历史";
				break;
			default:
				status = "";
				break;
			}
		}
		return status;
	}
	
	
}
